Configuration File
ApertureDB uses a configuration file (following a JSON format) that can be specified when starting the server using the "-cfg" flag:
./aperturedb -cfg config.json
If no configuration file is specified, ApertureDB will try to open the default file (config.json), and will fail to initiate if the file is not found.
Parameters
All the parameters in the configuration file are optional, as ApertureDB has default values for all of them.
All parameters can also be specified as environment variables, using the prefix "ADB_" and the parameter name in upper case. For instance, the parameter "port" can be specified as "ADB_PORT", and the parameter "session_token_max_age_sec" can be specified as "ADB_SESSION_TOKEN_MAX_AGE_SEC".
Note that environment variables will override the values specified in the configuration file.
Here is the list of all supported parameters:
Parameter | Explanation | Default |
---|---|---|
port | TCP port for incoming connections | 55555 |
max_simultaneous_clients | Number of max simultaneous connections open | 500 |
max_connection_message_size_mb | Maximum size of the query/response message in MB | 256 |
force_ssl | Flag that indicated whether or not SSL-based communication will be enforced by the server | true |
db_root_path | Path to the root folder where all filed/objects will be stored | db |
enable_dfs | Enable/disable use of distributed file system / object store. | false |
log_path | Directory where logs will be placed. | "/tmp" |
log_level | Levels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively | 1 (WARNING) |
verbose_log_level | Verbosity level beyond INFO, for debugging. Will set log_level = 0. Check Google glog documentation for details | -1 (no verbosity beyond INFO) |
log_cerr_threshold | Specify level of logging which will also be sent to stderr | 3 (FATAL) |
enable_audit_logs | Enable/disable audit logs | true |
include_audit_logs | When true, audit logs will be included in ApertureDB logs | false |
kvgd_db_size | Maximum size of the graph database in MB | 10 |
kvgd_db_sync | Enable/disable sync operation to disk on every transaction. When disable, latency will decrease but data loss may occur in case of crash | true |
locale_name | Locale used for string comparison | en_US |
zk_servers | Comma-separated list of Zookeeper server:port | "" |
zk_prefix | Same instance of Zookeeper can be used by multiple aperturedb clusters. Each cluster uses a different prefix to provide isolation between clusters. The config parameter zk_prefix specifies the path for the instance. | "testing" |
checkpoints_to_keep | Number of checkpoints that will be kept for recovery | 12 |
seconds_between_checkpoints | Interval in seconds between checkpoints | 7200 (2 hours) |
commits_between_checkpoints | Number of commits between checkpoints | 1024 |
collect_thread_interval | Number of seconds between collecting system status information | 1 |
collect_interval_set | An array of look-back intervals, in seconds, over which system status information is averaged | [5,10,30,120] |
resources_check_mem_limit | Limit on percentage of memory utilization after which queries are stopped | 93 |
resources_check_sleep | Number of seconds between resource utilization checks | 2 |
batch_time_to_live | Number of seconds that a batch is kept in memory before being cleanup up | 60 |
batch_cleaner_interval | Number of seconds between batch cleanup operations | 10 |
descriptorset_flusher_interval | Number of seconds between descriptor set cleanup operations | 1800 |
session_token_max_age_sec | Maximum duration of a session, in seconds | 36000 |
refresh_token_max_age_sec | Maximum duration of a refresh token, in seconds | 360000 |
Config File Example
Here is an example configuration file that has all the parameters with its default values. There is no need to specify any parameter if you want to work with default values.
// ApertureDB Config File
// All parameters show the default values.
{
// Network
"port": 55555,
"max_simultaneous_clients": 500,
"max_connection_message_size_mb": 256,
"force_ssl": true,
// DB paths
"db_root_path": "db",
"blobs_path": "db/blobs",
"images_path": "db/images",
"videos_path": "db/videos",
"descriptors_path": "db/descriptors",
// Log parameters
"log_path": "/tmp/",
"log_level": 1, // Warnings only
"verbose_log_level": 0,
"log_cerr_threshold": 3,
// Batching parameters
"batch_cleaner_interval": 10,
"batch_time_to_live": 60,
// Resource Check parameters
"resources_check_sleep": 2,
"resources_check_mem_limit": 93,
// Telemetry collection parameters
"collect_thread_interval": 1,
"collect_interval_set": [5,10,30,120]
"more-info": "ApertureDB"
}
Default Directories Structure
By default, ApertureDB will create a directory structure as follows:
db
├── blobs
├── descriptors
├── graph
└── images
├── jpg
├── png
└── videos